home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / ingres04.lzh / source / gutil / xfree.c < prev    next >
Encoding:
C/C++ Source or Header  |  1985-01-23  |  593 b   |  33 lines

  1. # include    <sccs.h>
  2.  
  3. SCCSID(@(#)xfree.c    8.1    12/31/84)
  4.  
  5. /*
  6. **  XFREE -- free memory only if dynamically allocated.
  7. **
  8. **    This acts just like "free", except that it does nothing
  9. **    if the area handed to it hasn't been dynamically allocated.
  10. **
  11. **    Parameters:
  12. **        p -- a pointer to the area to free.
  13. **
  14. **    Returns:
  15. **        none.
  16. **
  17. **    Side Effects:
  18. **        Free memory queue is changed.
  19. **
  20. **    WARNING:
  21. **        This routine depends on the implementation of malloc
  22. **        in C; it may have to be changed on other systems.
  23. */
  24.  
  25. xfree(p)
  26. char    *p;
  27. {
  28.     extern char    end[];
  29.  
  30.     if (p >= end && p < (char *) &p)
  31.         free(p);
  32. }
  33.